home *** CD-ROM | disk | FTP | other *** search
- package Local.Game.Thing
- {
- import Local.Game.World.*;
- import Local.Game.World.Map.*;
- import Local.Game.World.Map.Cell.*;
- import Local.Math.*;
- import STC9.System.*;
- import flash.display.*;
- import flash.events.*;
- import flash.geom.*;
-
- public class CShotScud extends CShot
- {
-
-
- private var mPath:CPath;
-
- private var mFlare:CThingAnimation;
-
- public function CShotScud(param1:CPosition, param2:CAngle, param3:*)
- {
- super(param1);
- mType = "scud";
- Process = Process_Normal;
- mAngle = param2;
- mAngle.InvertOrientation();
- mMaxLife = mLife = 50;
- mMaxSpeed = 100 * mSpriteScalar * mEnemySpeed;
- mSpeed = 0;
- mAcceleration = 1 * mEnemySpeed;
- mOrientation = 1;
- mShowOnMap = true;
- mTargetAirbourne = true;
- AddAnimation("stand",ScudMissile,"AddSprite_Black");
- SetCollisionBySprite(mAnimation[0]);
- AddThing(mFlare = new CThingAnimation(ScudMissile_Flare,"AddSprite_Scale"));
- §§push(§§findproperty(mTarget));
- if(true)
- {
- §§pop().mTarget = param3 is CPosition ? param3 : param3.mPosition.Clone();
- mPath = new CPath();
- mPath.SetPath_PD2(mPosition,mAngle.mDelta,mTarget);
- mPath.OrientateThing(this);
- IncrementFired();
- return;
- }
- §§goto(addr92);
- }
-
- override public function Draw() : void
- {
- var _loc1_:Matrix = null;
- var _loc2_:Point = null;
- if(true)
- {
- super.Draw();
- DrawTrail(4,150);
- }
- _loc1_ = GetOrientationMatrix();
- DrawSprite(_loc1_);
- _loc2_ = _loc1_.transformPoint(mSprite.mObjects["flare"].mPosition);
- if(true)
- {
- mFlare.mPosition.SetXY(_loc2_.x + mPosition.x,_loc2_.y + mPosition.y);
- if(true)
- {
- mFlare.mAngle.Copy(mAngle);
- }
- mFlare.Draw();
- }
- }
-
- public function Process_Normal() : void
- {
- var _loc1_:Point = null;
- Accelerate_Speed();
- mPath.MoveAlong(mSpeed);
- mPath.OrientateThing(this);
- mCollide.Update();
- if(MapMoveTrail())
- {
- Process_ReachedObjective();
- }
- Process_Children();
- _loc1_ = OrientatePoint(mSprite.mObjects["payload"].mPosition.clone(),mPosition);
- if(true)
- {
- if(_loc1_.y >= mLandscape.GetAltitude(_loc1_.x))
- {
- if(true)
- {
- AddThing(new CEffectExplosionLarge(new CPosition(_loc1_.x,mLandscape.GetAltitude(_loc1_.x))));
- if(true)
- {
- mDead = true;
- }
- §§goto(addr82);
- }
- DispatchDispose();
- }
- §§goto(addr82);
- }
- addr82:
- if(mDead)
- {
- }
- }
- }
- }
-